<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hzb.erp.api.pc.shop.mapper.OrderItemMapper">
    <select id="getNamesByOrderId" resultType="java.lang.String">
        select group_concat(t2.item_name) from shop_order_item t2 where t2.order_id = #{orderId}
    </select>
    <select id="getList" resultType="com.hzb.erp.api.pc.shop.entity.OrderItem" parameterType="java.lang.Long">
        select t1.id,t1.item_type,t1.item_id,t1.item_name,t1.price,t1.quantity,t1.add_time,t1.cover
        from shop_order_item t1
        where t1.order_id = #{orderId}
    </select>
    <select id="getCourseIdsByOrderId" resultType="java.lang.Long" parameterType="java.lang.Long">
        select t1.item_id
        from shop_order_item t1
        where t1.order_id = #{orderId} and t1.item_type = 1
    </select>
</mapper>
